package org.fude.schedule;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ScheduledFuture;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

@Configuration
public class ScheduleConfig {
	
	private final static Logger logger = LoggerFactory.getLogger(ScheduleConfig.class);
	
	@Bean
	public ThreadPoolTaskScheduler threadPoolTaskScheduler() {
		ThreadPoolTaskScheduler sch = new ThreadPoolTaskScheduler();
		sch.afterPropertiesSet();
		return sch;
	}
	
	@Bean
	public Map<String, ScheduledFuture<?>> schMap(){
		return new ConcurrentHashMap<>();
	}
}
